package com.xwn.utils.core;

import org.apache.commons.lang3.StringUtils;

/**
 * 字符串操作Util
 * @Author duandw
 * @Date 2019/12/31 16:33
 **/
import java.util.UUID;

public class StringUtilsImpl extends StringUtils {
    public static final String SPLIT_COMMA = ",";

    public StringUtilsImpl() {
    }

    public static String genGetMethodName(String value) {
        return T.StringUtils.isBlank(value) ? null : "get" + value.substring(0, 1).toUpperCase() + value.substring(1);
    }

    public static String toUpperCase(String value) {
        return value == null ? null : value.toUpperCase();
    }

    public static String[] splitByComma(String value) {
        return T.StringUtils.isBlank(value) ? new String[0] : value.split(",");
    }

    public static String get32UUID() {
        return UUID.randomUUID().toString().trim().replaceAll("-", "");
    }

    public static boolean inString(String str, String strs, String separator) {
        if (isNotBlank(str) && isNotBlank(strs) && isNotBlank(separator)) {
            String[] var3 = strs.split(separator);
            int var4 = var3.length;

            for(int var5 = 0; var5 < var4; ++var5) {
                String s = var3[var5];
                if (str.equals(trim(s))) {
                    return true;
                }
            }
        }
        return false;
    }
}

